// StateTransition.h

#pragma once
#include "State.h"

enum StateTransitionType {ST_NONE, ST_LINE, ST_STATION};

class StateTransition
{
public:
	State*				m_StateA;
	State*				m_StateB;
	StateTransitionType m_TransitionType;
	int					m_Cost;

	StateTransition(State* A, State* B, int Cost=0)
	{
		m_StateA=A;
		m_StateB=B;
		m_StateA->m_Successors.push_back(m_StateB);
		m_StateB->m_Successors.push_back(m_StateA);
		m_StateA->m_SuccessorTransitions.push_back(this);
		m_StateB->m_SuccessorTransitions.push_back(this);
		if(A->m_Line!=B->m_Line)
			m_TransitionType=ST_LINE;
		else if(A->m_Station!=B->m_Station)
			m_TransitionType=ST_STATION;
		else
			m_TransitionType=ST_NONE;
		if(m_TransitionType==ST_LINE && Cost==0)
			m_Cost=7;
		else
			m_Cost=Cost;
	}
};